<template>
  <div class="page">
    <div class="page__bd page__bd_spacing">
      <div class="qh">切换店铺</div>
      <div class="weui-flex">
        <div class="weui-flex__item">
          <div class="placeholder center cursen">今日上新</div>
        </div>
        <div class="weui-flex__item">
          <div class="placeholder center">每日优选</div>
        </div>
      </div>

    </div>
    <div class="images">
      <div class="images-move">
        <div><img src="1.jpg"/></div>
        <div><img src="1.jpg"/></div>
        <div><img src="1.jpg"/></div>
        <div><img src="1.jpg"/></div>
        <div><img src="1.jpg"/></div>
        <p class="clearfix"></p>
      </div>
      <div class="dian">
        <div class="dq"></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </div>
    </div>
    <card v-for="item in data1"
          :key="item.id"
          :text="item.text"
          :images="item.images"
          :price="item.price"
          :jiage="item.jiage"
    ></card>
    <setTime :setTime="time"></setTime>
    <!--<menu v-for="item in data" :key="item.id"></menu>-->
  </div>


</template>

<script>
import card from '@/components/card'
import setTime from '@/components/setTime'

export default {
  data () {
    return {
      time: new Date(2018, 5, 10),
      data1: [
        {text: '(预付款)预售【泰国金枕头榴莲】', price: '￥26.8', jiage: '￥32.8', id: '1', images: '2.jpeg'},
        {text: '秒杀【智利进口鸡心李】', price: '￥25.8', jiage: '￥32.8', id: '2', images: '3.jpg'},
        {text: '【泰国金枕头榴莲】', price: '￥23.8', jiage: '￥32.8', id: '3', images: '4.png'},
        {text: '【泰国金枕头榴莲】', price: '￥22.8', jiage: '￥32.8', id: '4', images: '5.jpeg'},
        {text: '【泰国金枕头榴莲】', price: '￥24.8', jiage: '￥32.8', id: '5', images: '6.jpg'}
      ],
      userInfo: {}
    }
  },

  components: {
    card,
    setTime
  },

  methods: {
    bindViewTap () {
      const url = '../logs/main'
      wx.navigateTo({ url })
    },
    getUserInfo () {
      // 调用登录接口
      wx.login({
        success: () => {
          wx.getUserInfo({
            success: (res) => {
              this.userInfo = res.userInfo
            }
          })
        }
      })
    },
    clickHandle (msg, ev) {
      console.log('clickHandle:', msg, ev)
    }
  },

  created () {
    // 调用应用实例的方法获取全局数据
    this.getUserInfo()
  }
}
</script>

<style scoped>
  div{
    box-sizing: border-box;
  }
  .clearfix{
    clear: both;
  }
  .images{
    overflow: hidden;
    margin-top: 5px;
    width: 100%;
    position: relative ;
  }
  .images-move{
    width: 1875px;
  }
  .images-move div{

    width: 20%;
    float: left;
  }
  .images-move div img{
    width: 100%;
    margin: 0px;
    display: block;
  }
  .center{
    text-align: center;
    font-size: 16px;
    line-height: 40px;
    border-bottom: #ccc 1px solid;
  }
  .weui-flex{
    box-shadow:2px 2px 5px #BABABA;

  }
  .cursen{
    color: #ff542d;
    border-bottom: #ff542d 1px solid;
  }
  .dian div{
    width: 10px;
    height: 10px;
    margin: 0px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    position: absolute;
    bottom:20px;
    left: calc(50% - 55px);
  }

</style>
